#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, m = 10, r[100001], v[100001], a[100001], sa[100001], c[10];

inline void countingsort() {
	memset(c, 0, sizeof(c));
	for (ll i = 1; i <= n; ++i)
		++c[v[i]];
	for (ll i = 1; i <= 9; ++i)
		c[i] += c[i - 1];
	for (ll i = n; i; i--)
		r[sa[i]] = c[v[sa[i]]]--;
	for (ll i = 1; i <= n; ++i)
		sa[r[i]] = i;
}

inline void radixsort() {
	for (ll i = 1; i <= n; ++i)
		sa[i] = i;
	ll x = 1;
	for (ll i = 1; i <= m; ++i, x *= 10) {
		for (ll j = 1; j <= n; ++j)
			v[j] = a[j] / x % 10;
		countingsort();
	}	
	for (ll i = 1; i <= n; ++i)
		printf("%lld ", a[sa[i]]);
	printf("\n"); 
}

int main() {
	scanf("%lld", &n);
	for (ll i = 1; i <= n; ++i)
		scanf("%lld", &a[i]);
	radixsort();
	return 0;
}
